<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ include file="../../common/tagInclude.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<LINK href="${basePath}styleAdmin/css/portalinabox.css" type="text/css" rel="stylesheet">	
<script type="text/javascript" src="${basePath}styleAdmin/js/common.js"></script>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<title>消息同步</title>
<script type="text/javascript">
function contentSendCheck(){
	var all_checkbox = document.getElementsByName("websiteId");
	if(isChecked("websiteId") == false ){
		alert('至少选择一个同步地址');
	}else{
		if(!confirm('确认要同步?'))return;
		var websiteIds = "";
		var websiteLen = all_checkbox.length;
		for(var i=0;i<websiteLen ;i++){
			if(all_checkbox[i].checked)
				websiteIds += "," + all_checkbox[i].value;
		}
		if(websiteIds.length > 1)
			websiteIds = websiteIds.substring(1);

		var all_checkbox_contentId = document.getElementsByName("contentId");
		var contentIds = "" ;
		var contentLen = all_checkbox_contentId.length;
		for(var i=0;i<contentLen ;i++){
			if(all_checkbox_contentId[i].checked)
				contentIds += "," + all_checkbox_contentId[i].value;
		}
		if(contentIds.length > 1)
			contentIds = contentIds.substring(1);
		
		window.location = '${basePath}synch/contentInfo/contentSend.do?contentId=' + contentIds + "&websiteId=" + websiteIds ;
	}
}
</script>
</head>
<body bottomMargin="0" leftMargin="0" rightMargin="0" topmargin="0">
<form name="myform" method="post" action="">
<input type="hidden" id="msgIds" name="msgIds" value="">
<%@include file="../common/navigate.jsp" %>
<table width="96%" border="0" align="center" cellpadding="0" style="margin-top:5px;" cellspacing="0">
	<tr>
		<td valign="top">
			<!-- 搜索栏 -->
			<table width="100%" border="1" class="mainFunctionTable"  cellpadding="0" cellspacing="1">
				<tr height="25" class="pLabel">
			   		<td class="td_nwarpstyle">&nbsp;&nbsp;文章同步列表</td>
			 	</tr>
				<tr>
			   		<td width="100%" height="25">
			   			<table width="100%" border="0" cellspacing="1">
			   				<c:forEach var="content" items="${contentInfoList}">
			     			<tr height="25px"><td height="23" width="10%">标题:${content.title}<div style="display:none"><input type="checkbox" name="contentId" id="contentId" value="${content.contentId}" checked="checked"/></div></td></tr>
			     			</c:forEach>
			    		</table>
			    	</td>
			   </tr>
			   <tr height="25" class="pLabel">
			   		<td class="td_nwarpstyle">
			   		&nbsp;&nbsp;同步地址选择(不能同步给自身)</td>
			 	</tr>
				<tr>
			   		<td width="100%" height="25">
			   			<table width="100%" border="0" cellspacing="1">
			   				<c:forEach var="websiteInfo" items="${websiteInfoList}">
								<c:choose>
									<c:when test="${websiteInfo.isSelf == 1 }">
										<input type="checkbox" name="testId" id="testId" value="${websiteInfo.id}" disabled="disabled">${websiteInfo.name}&nbsp;&nbsp;
									</c:when>
									<c:otherwise>
										<input type="checkbox" name="websiteId" id="websiteId" value="${websiteInfo.id}">${websiteInfo.name}&nbsp;&nbsp;
									</c:otherwise>
								</c:choose>
							</c:forEach>
			    		</table>
			    	</td>
			   </tr>
			   <tr align="left">
		         <td align="center" colspan="2">
		          <a href="javascript:contentSendCheck();"><img src="${basePath}styleAdmin/images/button/tongbu.gif" border=0></a>
		          &nbsp;&nbsp;
		    		<a href="javascript:history.go(-1);"><img src="${basePath}styleAdmin/images/button/exit.gif" border=0></a>
		         </td>
       		</tr>
		</table>
		  </td>
	  </tr>
</table>
</form>
</body>
</html>